home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
qbprog.EXE
/
ZAR.BAS
< prev
next >
Wrap
BASIC Source File
|
1995-04-25
|
6KB
|
255 lines
DECLARE SUB SIL ()
DECLARE SUB ALTMENU ()
DECLARE SUB Z1B ()
DECLARE SUB Z2B ()
DECLARE SUB Z3B ()
DECLARE SUB Z4B ()
DECLARE SUB Z5B ()
DECLARE SUB Z6B ()
DECLARE SUB Z1 ()
DECLARE SUB Z2 ()
DECLARE SUB Z3 ()
DECLARE SUB Z4 ()
DECLARE SUB Z5 ()
DECLARE SUB Z6 ()
MUZIK$ = "o3 L8 E D+ E D+ E o2 B o3 D C L2 o2 A"
CONST ESC = 27
NAME1SCR = 0: NAME2SCR = 0:
CALL ALTMENU
COLOR 14: LOCATE 7, 29: INPUT "HOW MANY PLAYERS WILL PLAY = ", PL
IF PL = 1 THEN GOTO 1 ELSE GOTO 1000
DO
CALL SIL
1 COLOR 14: LOCATE 7, 40: PRINT SPC(35); : LOCATE 7, 29: INPUT "GUESS THE SUM OF DICES = ", B
IF B < 2 OR B > 12 THEN GOTO 1
RANDOMIZE TIMER
D1 = INT(RND * 6) + 1
D2 = INT(RND * 6) + 1
XX = D1 + D1
LOCATE 9, 28: COLOR 1: PRINT "1.st DICE"; D1; : COLOR 2: PRINT " 2.nd DICE"; D2: LOCATE 16, 33: COLOR 10: PRINT "SUM OF DICES IS"; D1 + D2
LOCATE 11: DRAW "BM230,145 R60D65L60U65":
DRAW "BR60BD65BR60BU65": DRAW "R60D65L60U65"
IF D1 = 1 THEN
CALL Z1
ELSEIF D1 = 2 THEN CALL Z2
ELSEIF D1 = 3 THEN CALL Z3
ELSEIF D1 = 4 THEN CALL Z4
ELSEIF D1 = 5 THEN CALL Z5
ELSEIF D1 = 6 THEN CALL Z6
END IF
IF D2 = 1 THEN
CALL Z1B
ELSEIF D2 = 2 THEN CALL Z2B
ELSEIF D2 = 3 THEN CALL Z3B
ELSEIF D2 = 4 THEN CALL Z4B
ELSEIF D2 = 5 THEN CALL Z5B
ELSEIF D2 = 6 THEN CALL Z6B
END IF
IF B = D1 + D2 THEN LOCATE 21, 3: PRINT "CONGRATULATIONS! YOU WIN!!!": PLAY "MB X" + VARPTR$(MUZIK$): GOTO 100
LOCATE 21, 3: PRINT "SORRY! YOU LOST !"
100 LOCATE 21, 41: INPUT "DO YOU WANT TO DICE AGAIN ? (Y / N) ", Resp$
PRINT
LOOP UNTIL UCASE$(MID$(Resp$, 1, 1)) = "N"
END
'-----------------------------------------------------------------------
1000 'oyuncu oyuncuya karsi
CALL ALTMENU
COLOR 14: LOCATE 7, 3: INPUT "ENTER 1.st PLAYERS NAME = ", NAME1$
LOCATE 7, 42: INPUT "ENTER 2.nd PLAYERS NAME = ", NAME2$
DO
CALL SIL
LOCATE 9, 3: PRINT "1.st Player": LOCATE 10, 3: PRINT NAME1$
LOCATE 9, 67: PRINT "2.nd Player": LOCATE 10, 67: PRINT NAME2$
LOCATE 11, 3: PRINT "SCORE="; NAME1SCR: LOCATE 11, 67: PRINT "SCORE="; NAME2SCR
X = X + 1
SELECT CASE X
CASE 1, 3, 5, 7, 9
LOCATE 5, 31: PRINT NAME1$; " is playing..."
CASE 2, 4, 6, 8, 10
LOCATE 5, 31: PRINT NAME2$; " is playing..."
CASE ELSE
IF NAME1SCR > NAME2SCR THEN CALL SIL: LOCATE 14, 25: PRINT NAME1$; " WIN THE DICE GAME !!!": BEEP: BEEP
IF NAME1SCR < NAME2SCR THEN CALL SIL: LOCATE 14, 25: PRINT NAME2$; " WIN THE DICE GAME !!!": BEEP: BEEP
IF NAME1SCR = NAME2SCR THEN CALL SIL: LOCATE 14, 25: PRINT " EQUAL SCORE !!!"
' END IF
END
END SELECT
1001 COLOR 14: LOCATE 7, 53: PRINT SPC(26); : LOCATE 7, 29: INPUT "GUESS THE SUM OF DICES = ", B
IF B < 2 OR B > 12 THEN GOTO 1001
RANDOMIZE TIMER
D1 = INT(RND * 6) + 1
D2 = INT(RND * 6) + 1
XX = D1 + D2
LOCATE 9, 28: COLOR 1: PRINT "1.st DICE"; D1; : COLOR 2: PRINT " 2.nd DICE"; D2: LOCATE 16, 33: COLOR 10: PRINT "SUM OF DICES IS"; D1 + D2
LOCATE 11: DRAW "BM230,145 R60D65L60U65":
DRAW "BR60BD65BR60BU65": DRAW "R60D65L60U65"
IF D1 = 1 THEN
CALL Z1
ELSEIF D1 = 2 THEN CALL Z2
ELSEIF D1 = 3 THEN CALL Z3
ELSEIF D1 = 4 THEN CALL Z4
ELSEIF D1 = 5 THEN CALL Z5
ELSEIF D1 = 6 THEN CALL Z6
END IF
IF D2 = 1 THEN
CALL Z1B
ELSEIF D2 = 2 THEN CALL Z2B
ELSEIF D2 = 3 THEN CALL Z3B
ELSEIF D2 = 4 THEN CALL Z4B
ELSEIF D2 = 5 THEN CALL Z5B
ELSEIF D2 = 6 THEN CALL Z6B
END IF
SELECT CASE X
CASE 1, 3, 5, 7, 9
IF B = XX THEN NAME1SCR = NAME1SCR + 1 ELSE NAME1SCR = NAME1SCR
CASE 2, 4, 6, 8, 10
IF B = XX THEN NAME2SCR = NAME2SCR + 1 ELSE NAME2SCR = NAME2SCR
END SELECT
1009 IF B = D1 + D2 THEN LOCATE 21, 3: PRINT "CONGRATULATIONS! YOU WIN!!!": PLAY "MB X" + VARPTR$(MUZIK$): GOTO 1010
LOCATE 21, 3: PRINT "SORRY! YOU LOST !"
1010 LOCATE 21, 41: INPUT "DO YOU WANT TO DICE AGAIN ? (Y / N) ", Resp$
PRINT
LOOP UNTIL UCASE$(MID$(Resp$, 1, 1)) = "N"
END
SUB ALTMENU
SCREEN 9
COLOR 14, 12: CLS : LOCATE 1, 1: PRINT "█";
FOR I = 1 TO 78
PRINT "▀";
NEXT I
PRINT "█";
FOR I = 2 TO 22
LOCATE I, 1: PRINT "█"
NEXT I
PRINT "█";
FOR I = 1 TO 78
PRINT "▄";
NEXT I
PRINT "█";
FOR I = 2 TO 22
LOCATE I, 80: PRINT "█"
NEXT I
LOCATE 6, 1
COLOR 14: PRINT "█";
FOR I = 1 TO 78
COLOR 1: PRINT "▀";
NEXT I
LOCATE 8, 1
COLOR 14: PRINT "█";
FOR I = 1 TO 78
COLOR 1: PRINT "▄";
NEXT I
LOCATE 20, 1
COLOR 14: PRINT "█";
FOR I = 1 TO 78
COLOR 1: PRINT "▀";
NEXT I
COLOR 14, 12: LOCATE 3, 1: PRINT "█";
FOR I = 1 TO 78
PRINT "▄";
NEXT I
PRINT "█";
LOCATE 22, 2: FOR I = 1 TO 78: PRINT "▄"; : NEXT I: COLOR 14, 12
COLOR 4: LOCATE 2, 2: FOR I = 1 TO 78: PRINT "█"; : NEXT I: COLOR 14, 12
LOCATE 2, 28: COLOR 2: PRINT "A DICE GAME BY NESIM RAZON":
END SUB
SUB SIL
LOCATE 7, 2: PRINT SPC(78);
FOR I = 9 TO 19
LOCATE I, 2: PRINT SPC(78);
NEXT I
LOCATE 9, 1: PRINT "█": LOCATE 10, 1: PRINT "█"
LOCATE 21, 2: PRINT SPC(78);
END SUB
SUB Z1
COLOR 14: LOCATE 12, 33: PRINT "■"
END SUB
SUB Z1B
COLOR 14: LOCATE 12, 48: PRINT "■"
END SUB
SUB Z2
COLOR 14: LOCATE 12, 32: PRINT "■ ■"
END SUB
SUB Z2B
COLOR 14: LOCATE 12, 47: PRINT "■ ■"
END SUB
SUB Z3
COLOR 14: LOCATE 12, 32: PRINT "■■■"
END SUB
SUB Z3B
COLOR 14: LOCATE 12, 47: PRINT "■■■"
END SUB
SUB Z4
COLOR 14: LOCATE 11, 32: PRINT "■ ■"
COLOR 14: LOCATE 12, 32: PRINT "■ ■"
END SUB
SUB Z4B
COLOR 14: LOCATE 11, 47: PRINT "■ ■"
COLOR 14: LOCATE 12, 47: PRINT "■ ■"
END SUB
SUB Z5
COLOR 14: LOCATE 11, 32: PRINT "■ ■"
COLOR 14: LOCATE 12, 32: PRINT " ■ "
COLOR 14: LOCATE 13, 32: PRINT "■ ■"
END SUB
SUB Z5B
COLOR 14: LOCATE 11, 47: PRINT "■ ■"
COLOR 14: LOCATE 12, 47: PRINT " ■ "
COLOR 14: LOCATE 13, 47: PRINT "■ ■"
END SUB
SUB Z6
COLOR 14: LOCATE 11, 32: PRINT "■ ■"
COLOR 14: LOCATE 12, 32: PRINT "■ ■"
COLOR 14: LOCATE 13, 32: PRINT "■ ■"
END SUB
SUB Z6B
COLOR 14: LOCATE 11, 47: PRINT "■ ■"
COLOR 14: LOCATE 12, 47: PRINT "■ ■"
COLOR 14: LOCATE 13, 47: PRINT "■ ■"
END SUB